package com.tools.cloud.controller;

import com.tools.cloud.api.model.CommonResult;
import com.tools.cloud.api.model.Payment;
import com.tools.cloud.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/payment")
@Slf4j
public class ConsumerController {
    @Autowired
    private PaymentService service;

    @RequestMapping(value = "/selectOne", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<Payment> selectOne(Payment param) {
        CommonResult<Payment> result = new CommonResult<Payment>();
        try {
            return service.selectOne(param);
        } catch(Exception e) {
            log.error("", e);
            return CommonResult.getErrObj("查询异常！");
        }
    }
}
